package com.huohuo.javabasic.reference;

import java.lang.ref.PhantomReference;
import java.lang.ref.ReferenceQueue;

/**
 * 虚引用
 */
public class PhantomReferenceTest {
    public static void main(String[] args) {
        String a = "aaaaaaaaa";
        ReferenceQueue<String> queue = new ReferenceQueue<>();
        PhantomReference phantomReference = new PhantomReference(a,queue);
        System.out.println(phantomReference.get());
    }
}
